-
Notifications
You must be signed in to change notification settings - Fork 156
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[8.16](backport #6199) Integration tests autodiscovery #6399
Conversation
Cherry-pick of a7597b0 has failed:
To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally |
@Mergifyio rebase |
☑️ Nothing to do
|
This pull request is now in conflicts. Could you fix it? 🙏
|
* Define output model and yaml output * Add integration test autodiscovery flags * Change assertions to ElementsMatch in define autodiscovery tests
d9e2699
to
6b95cea
Compare
|
What does this PR do?
Implement integration test autodiscovery using a plain
go test
call likego test -tags integration github.com/elastic/elastic-agent/testing/integration -v -args -integration.dry-run=true -integration.autodiscover
.The YAML output is written in a file (by default
discovered_tests.yaml
) and is structured like the sample below (some parts have been omitted to keep the sample short)In order to filter the output we can use a tool like yq
➜ elastic-agent git:(integration-tests-autodiscovery) ✗ yq '[.[].groups.[].name] | unique' testing/integration/discovered_tests.yaml
Why is it important?
This is necessary to dynamically generate CI steps or provisioning for running the tests on the appropriate platforms
Checklist
./changelog/fragments
using the changelog toolDisruptive User Impact
How to test this PR locally
In order to generate the YAML file we can run
go test -tags integration github.com/elastic/elastic-agent/testing/integration -v -args -integration.dry-run=true -integration.autodiscover
this will generate a file in
<repo root>/testing/integration/discovered_tests.yaml
It can be combined with the existing group and sudo filters (see
-integration.groups
and-integration.sudo
)Related issues
Questions to ask yourself
This is an automatic backport of pull request #6199 done by [Mergify](https://mergify.com).